class Statements:
    @staticmethod
    def main():
        Statements._if()
        Statements._while()
        Statements._while_else()
        Statements._for()
        Statements._for_else()
        Statements._match()
        Statements._fun_arguments_dict(100, 'xyz', c=-1)
        Statements._fun_arguments_tuple(100, 'xyz', -1)

    @staticmethod
    def _if():
        i: int = 0
        if i == 0:
            print('i == 0')
        elif i > 0:
            print('i > 0')
        else:
            print('i < 0')

    @staticmethod
    def _while():
        i: int = 0
        while i < 10:
            print(f'i < 10 when i = {i}')
            i += 1
            if i == 5:
                continue
            elif i == 6:
                break
        else:
            # 当 while 第一次检测失败时发生
            print(f'while else: i = {i}')

    @staticmethod
    def _while_else(i: int = 10):
        while i < 10:
            print(f'i = {i}')
            i += 1
            break
        else:
            # 当 while 第一次检测失败时发生
            print(f'while else: i = {i}')

    @staticmethod
    def _for():
        for i in range(10):
            print(f'for i = {i}')
            if i == 5:
                continue
            elif i == 6:
                break
        else:
            # 当 for 第一次检测失败时发生
            print(f'for else: i = {i}')

    @staticmethod
    def _for_else():
        for i in range(0):
            print(f'for i = {i}')
            if i == 5:
                continue
            elif i == 6:
                break
        else:
            # 当 for 第一次检测失败时发生
            print(f'for else')

    @staticmethod
    def _match():
        flag = False
        match (100, 200):
            case (100, 300):  # Mismatch: 200 != 300
                print('Case 1')
            case (100, 200) if flag:  # Successful match, but guard fails
                print('Case 2')
            case (100, y):  # Matches and binds y to 200
                print(f'Case 3, y: {y}')
            case _:  # Pattern not attempted
                print('Case 4, I match anything!')

    @staticmethod
    def _fun_arguments_dict(a:int=0, b:str='b', **args):
        print(f'type = {type(args)}, value = {args}')

    @staticmethod
    def _fun_arguments_tuple(a:int=0, b:str='b', *args):
        print(f'type = {type(args)}, value = {args}')
        
if __name__ == "__main__":
    Statements.main()
